from django.shortcuts import render

# Create your views here.
from rest_framework.generics import RetrieveAPIView

from rest_framework.viewsets import ModelViewSet
from good.serializers import *
from utils.permission import BackendPermission


class GoodsCategoryBackendViewSet(ModelViewSet):
    """
    商品种类相关信息
    """
    queryset = GoodsCategory.objects.filter(is_deleted='0')
    permission_classes = [BackendPermission]
    serializer_class = GoodsCategorySerializer


class GoodsBackendViewSet(ModelViewSet):
    """
    后台的商品相关信息
    """
    queryset = Goods.objects.filter(is_deleted='0')
    permission_classes = [BackendPermission]
    serializer_class = GoodsBackendSerializer
